﻿using EasyCore.Caching.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyCore.Caching.Redis
{
    /// <summary>
    /// <inheritdoc cref="IEasyCacheService"/>
    /// Redis缓存
    /// </summary>

    public partial class RedisCacheService : IEasyCacheService
    {
        /// <inheritdoc/>
        public void HashAdd<T>(string key, string hashKey, T value)
        {
            _simpleRedis.HashAdd<T>(key, hashKey, value);
        }

        /// <inheritdoc/>
        public bool HashSet<T>(string key, Dictionary<string, T> dic)
        {
            return _simpleRedis.HashSet<T>(key, dic);
        }

        /// <inheritdoc/>
        public int HashDel<T>(string key, params string[] fields)
        {
            return _simpleRedis.HashDel<T>(key, fields);
        }

        /// <inheritdoc/>
        public List<T> HashGet<T>(string key, params string[] fields)
        {
            return _simpleRedis.HashGet<T>(key, fields);
        }

        /// <inheritdoc/>
        public T HashGetOne<T>(string key, string field)
        {
            return _simpleRedis.HashGetOne<T>(key, field);
        }

        /// <inheritdoc/>
        public IDictionary<string, T> HashGetAll<T>(string key)
        {
            return _simpleRedis.HashGetAll<T>(key);
        }
    }
}
